#pragma once

#include <time.h>

#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/exponential_distribution.hpp>

#include "boost/random/linear_congruential.hpp"
#include <boost/random/variate_generator.hpp>

typedef boost::random::normal_distribution<> NormalDistribution;
typedef boost::mt19937 RandomGenerator;

#include "Config.h"

class Generator
{
public:

	Generator(void)
	{
	}

	virtual ~Generator(void)
	{
	}			

	static int GetNormal(int mean, int sd)
	{								
		float d = die();

		int value = (int)(d * sd + mean);		
		return value;
	}

	static int GetUniform(int min, int max)
	{
		if(!initializated)
		{
			srand(time(NULL));
			initializated = true;
		}

		int value = (rand() % (max - min)) + min;
		return value;
	}

	static int GetTimeFromSeconds(int seconds)
	{
		return seconds / Config::SecPerTick;
	}

private:
	static bool initializated;
	static RandomGenerator r;
	static NormalDistribution n;
	static boost::variate_generator<RandomGenerator&, NormalDistribution > die;
};